package com.joymart.compute.model;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Optional;

/**
 * 金额聚合
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AmountAggregation {
    private int orderCount;
    private BigDecimal amount;

    public BigDecimal getAmount() {
        return Optional.ofNullable(amount).orElse(BigDecimal.ZERO);
    }
}
